<h3 xmlns="http://www.w3.org/1999/html">Lista artikala</h3>
<button class="btn btn-success" ng-click="izmeniArtikal('novi')" data-toggle="modal" href="#editModal">
	<i class="icon-calendar icon-white"></i>
	&nbsp;Kreiraj novi artikal
</button>
<div class="pull-right">
	<label>Pronađi artikal: &nbsp;</label>
	<input ng-model="search.$" class="form-control">
</div>	
<table id="searchObjResults" class='table table-striped'>
    <thead>
    <tr>
        <th>Artikal</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
    </tr>
    </thead>
    <tbody>
    <tr style="height: 45px;">
		<td>
			<label ng-click="orderByField = 'nazivArtikla'; reverseSort = !reverseSort">
				<b>Naziv</b>
				<span ng-show="orderByField == 'nazivArtikla'">
					<span ng-show="!reverseSort" class="glyphicon glyphicon-chevron-down"></span>
					<span ng-show="reverseSort" class="glyphicon glyphicon-chevron-up"></span>
				</span>
			</label>
		</td>
		<td>
			<label ng-click="orderByField = 'ambalaza'; reverseSort = !reverseSort">
				<b>Ambalaža</b>
				<span ng-show="orderByField == 'ambalaza'">
					<span ng-show="!reverseSort" class="glyphicon glyphicon-chevron-down"></span>
					<span ng-show="reverseSort" class="glyphicon glyphicon-chevron-up"></span>
				</span>
			</label>
		</td>
		<td>
			<label ng-click="orderByField = 'cena'; reverseSort = !reverseSort">
				<b>Cena</b>
				<span ng-show="orderByField == 'cena'">
					<span ng-show="!reverseSort" class="glyphicon glyphicon-chevron-down"></span>
					<span ng-show="reverseSort" class="glyphicon glyphicon-chevron-up"></span>
				</span>
			</label>
		</td>
		<td>
			<label ng-click="orderByField = 'distributer'; reverseSort = !reverseSort">
				<b>Distributer</b>
				<span ng-show="orderByField == 'distributer'">
					<span ng-show="!reverseSort" class="glyphicon glyphicon-chevron-down"></span>
					<span ng-show="reverseSort" class="glyphicon glyphicon-chevron-up"></span>
				</span>
			</label>
		</td>
		<td>
			<label ng-click="orderByField = 'kategorija'; reverseSort = !reverseSort">
				<b>Kategorija</b>
				<span ng-show="orderByField == 'kategorija'">
					<span ng-show="!reverseSort" class="glyphicon glyphicon-chevron-down"></span>
					<span ng-show="reverseSort" class="glyphicon glyphicon-chevron-up"></span>
				</span>
			</label>
		</td>
		<td></td><td></td>
    </tr>
    <tr ng-repeat='artikal in artikli | orderBy:orderByField:reverseSort | filter:search:strict' onload="JavaScript:timedRefresh(500);">
        <td>{{artikal.nazivArtikla}}</td>
        <td>{{artikal.ambalaza}}</td>
        <td>{{artikal.cena}} din.</td>
        <td>{{artikal.distributerID}}</td>
        <td>{{artikal.nazivKategorije}}</td>
        <td><a ng-controller="PromeniArtikalListCtrl" class='btn btn-warning' ng-click="izmena(artikal);" href="#/promeniArtikal">Izmeni</a></td>
        <td><button ng-controller="ArtikalListCtrl" class="btn btn-danger" ng-click="delete(artikal)">
                <span class="glyphicon glyphicon-trash"></span> &nbsp;Obriši
            </button>
        </td>
    </tr>
    </tbody>
</table>
<div class="modal fade"  tabindex="-1" role="dialog" ng-include="'view/artikal-detalji.html'" id="editModal" aria-hidden="true"></div>
</div>